package com.smart.draw;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

// 1. 继承 SpringBootServletInitializer 以支持 war 部署
// 2. 添加 @ServletComponentScan 扫描 @WebServlet, @WebFilter, @WebListener
//ServletComponentScan(basePackages = "net.sourceforge.plantuml.servlet") // 扫描 PlantUML 的 Servlet
@SpringBootApplication(scanBasePackages = "com.smart.draw")
public class SmartPlantUmlApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(SmartPlantUmlApplication.class, args);
    }

    // 重写 configure 方法，支持外部 Tomcat 部署
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SmartPlantUmlApplication.class);
    }
}
